package cn.edu.zut.internship.web.controller.setting;

import cn.edu.zut.internship.bean.sys.Result;
import cn.edu.zut.internship.bean.sys.SysUser;
import cn.edu.zut.internship.iservice.setting.SettingSV;
import cn.edu.zut.internship.web.utils.UserInfoUtil;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/setting")
public class SettingController {
    @Reference
    SettingSV settingSV;

    /**
     * 获取成绩比例设置值
     * @param
     * @return
     */
    @RequestMapping("/getResultSetting")
    public Result getResultSetting() {
        Result result = new Result();
        result = settingSV.getResultSetting();
        return result;
    }
    /**
     * 修改成绩比例设置值
     * @param
     * @return
     */
    @RequestMapping("/editResultSetting")
    public Result editResultSetting(@RequestBody Map params) {
        Result result = new Result();
        result = settingSV.editResultSetting(params);
        return result;
    }

    /**
     * 修改报告模板
     * @param params
     * @return
     */
    @RequestMapping("/editReportTemplate")
    public Result editReportTemplate(@RequestBody Map params) {
        Result result = new Result();
        result = settingSV.editReportTemplate(params);
        return result;
    }

    /**
     * 获取报告模板下载链接
     * @param
     * @return
     */
    @RequestMapping("/getReportTemplate")
    public Result getReportTemplate() {
        Result result = new Result();
        result = settingSV.getReportTemplate();
        return result;
    }

    /**
     * 修改系统当前学期
     * @return
     */
    @RequestMapping("/editSemesterSetting")
    public Result editSemesterSetting(@RequestBody Map params) {
        Result result = new Result();
        result = settingSV.editSemesterSetting(params);
        return result;
    }

    /**
     * 获取系统当前学期
     * @return
     */
    @RequestMapping("/getSemesterSetting")
    public Result getSemesterSetting() {
        Result result = new Result();
        result = settingSV.getSemesterSetting();
        return result;
    }
}
